<!DOCTYPE html>
<html>
<head lang="zh_cn">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div id="testdiv">
    <p id="testp">hello PHP!</p>
</div>
<ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>
<script src="fun.js"></script>
<script>
    var testdiv = document.getElementById('testdiv');
    var testp = document.getElementById("testp");
    var tul = document.getElementsByTagName("li");

    alert(tul[1]);
    //把一个新元素插入到一个现在的元素 insertBefore(newElement,targetElement);
    testdiv.parentNode.insertBefore(tul[3],testdiv);
    //把现有元素后插入一个新元素
    insertAfter(tul[2],testdiv);
</script>
</body>
</html>